/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package procesos;


import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 *
 * @author Mario
 */

public class Main {

    public static void main(String[] args) {

	try{

	    String str_proceso = null;
	    String admin =
		System.getenv("windir") + "\\system32\\" + "tasklist.exe";
	    Process proceso = Runtime.getRuntime().exec(admin);
	    BufferedReader input = new BufferedReader(
		    new InputStreamReader(proceso.getInputStream()));
	    while((str_proceso = input.readLine()) != null){
		System.out.println(str_proceso);
	    }
	    input.close();

	}catch(Exception e){
	    e.printStackTrace();
	}
    }
}